<template>
  <el-form :inline="true" style="text-align: right" @submit.native.prevent>
 
    <el-form-item>
      <el-input
        v-model="formSearch.userName"
        placeholder="输入用户名或姓名搜索"
        prefix-icon="el-icon-search"
        @keyup.enter.native="onSearch"
      />
    </el-form-item>
    <el-form-item>
      <el-button type="primary" plain @click="$emit('onShowEdit')">新增用户</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  data() {
    return {
      formSearch: {}
    }
  },
  methods: {
    // 回车查询
    onSearch() {
      this.$store.dispatch('userMg/loadData', this.formSearch)
    },
  }
}
</script>

<style lang="scss" scoped>
$bg-color: #9580f9;
.name-str {
  color: $bg-color;
}
</style>
